import { findUserinfo } from '@/apis/auth.ts'
import { defineComponent, reactive } from 'vue'
import { useRouter } from 'vue-router'
import "./index.scss"
export default defineComponent({
    name: 'login-view',
    setup() {
        const router = useRouter()
        const formData = reactive({
            username: '',
            password: '',
        })

        const onSubmit = async () => {
            console.log('submit!', formData.username)
            await getUserinfo()
            router.push('/')
        }

        const getUserinfo = async () => {
            const result = await findUserinfo()
            if (result?.code !== 0) return
            console.log(result.data)
        }
        return () => (
            <div class={'dashboard-page__container'}>
                <div class="text-center">login</div>
            </div>
        )
    },
})
